#ifndef __WLMATH_H__
#define __WLMATH_H__
#include <d3dx9math.h>
class WLVector3 : public D3DXVECTOR3
{
public:
	WLVector3()
	{
		this->D3DXVECTOR3::D3DXVECTOR3();
	}
	WLVector3( const D3DXVECTOR3& V )
	{
		this->x = V.x;
		this->y = V.y;
		this->z = V.z;
	
	}
	WLVector3( CONST FLOAT * S )
	{
		this->D3DXVECTOR3::D3DXVECTOR3( S );
	}
	WLVector3( CONST WLVector3& V )
	{
		this->D3DXVECTOR3::D3DXVECTOR3( V );
	
	}
	WLVector3( CONST D3DXFLOAT16 * f )
	{
		this->D3DXVECTOR3::D3DXVECTOR3( f );
	}
	WLVector3( FLOAT x, FLOAT y, FLOAT z )
	{
		this->D3DXVECTOR3::D3DXVECTOR3( x, y, z );
	}
	float Size()
	{
		return ::sqrtf(x*x + y*y + z*z);
	}

	WLVector3 Normalize()
	{
		WLVector3 Vec;
		float size = Size();
		if ( size>0.0001 )
		{
			Vec.x = x/size;
			Vec.y = y/size;
			Vec.z = z/size;
		}
		return Vec;
	}
};
inline WLVector3 WLVec3Cross
    ( const WLVector3& V1, const WLVector3& V2 )
{
    WLVector3 v;

    v.x = V1.y * V2.z - V1.z * V2.y;
    v.y = V1.z * V2.x - V1.x * V2.z;
    v.z = V1.x * V2.y - V1.y * V2.x;
    return v;
}
class WLMatrix16 : public D3DXMATRIXA16
{

};
class WLQuaternion :public D3DXQUATERNION
{
public:
    WLQuaternion()
	{
		this->D3DXQUATERNION::D3DXQUATERNION();
	}
	WLQuaternion( CONST FLOAT * pf)
	{
		this->D3DXQUATERNION::D3DXQUATERNION(pf);
	}
	WLQuaternion( CONST D3DXFLOAT16 * pf)
	{
		this->D3DXQUATERNION::D3DXQUATERNION(pf);
	}
	WLQuaternion( FLOAT x, FLOAT y, FLOAT z, FLOAT w )
	{
		this->D3DXQUATERNION::D3DXQUATERNION(x,y,z,w);
	}
};

#endif